/**
 * 构造函数：
 *
 * 属性 放在实例: 区分个体目标
 * 方法 prototype
 *
 */
class BaseModel {
  // data = {} message = string
  constructor(data, message) {
    if (typeof data === 'string') {
      this.message = data;
      data = null;
      message = null;
    }
    if (data) {
      this.data = data;
    }
    if (message) {
      this.message = message;
    }
  }
}

// class Index extends React.Component {
//   constructor(props) {
//     super(props)
//     this.state = {}
//   }
// }

class SuccessModel extends BaseModel{
  constructor(data, message) {
    super(data, message) // 执行超类/父类
    this.errno = 0;
  }
}

class FailModel extends BaseModel{
  constructor(data, message) {
    super(data, message) // 执行超类/父类
    this.errno = -1;
  }
}

// exports.SuccessModel = SuccessModel
// exports.FailModel = FailModel

module.exports = {
  SuccessModel,
  FailModel
}